//
//  LTM_CollectionViewLayout.h
//  LTM_Inherit_Adapt_Objc
//
//  Created by zsn on 2022/3/30.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

/// UICollectionView 排列顺序
typedef enum : NSUInteger {
    /// 左排列
    CollectionViewAlignmentTypeLeft,
    /// 右排列
    CollectionViewAlignmentTypeRight,
} CollectionViewAlignmentType;

/// 排列协议
@protocol CollectionViewAlignmentLayoutDelegate <NSObject>
@required

/**
 item的大小
 */
- (CGSize)collectionViewSizeForItemAtIndexPath:(NSIndexPath *)indexPath;

@optional
/**
 SectionHeader/SectionFooter 的大小
 */
-(CGSize)collectionViewElementOfKind:(NSString *)elementOfKind referenceSizeInSection:(NSInteger)section;

@end

@interface LTM_CollectionViewLayout : UICollectionViewFlowLayout
/// 排列代理
@property(nonatomic , weak) id <CollectionViewAlignmentLayoutDelegate> alignmentDelegate;
/// 排列方式
@property(nonatomic ,assign) CollectionViewAlignmentType alignmentType;
@end

NS_ASSUME_NONNULL_END
